<?php

class TugasWewenangController extends Controller
{
	/**
	 * @var string the default layout for the views. Defaults to '//layouts/column2', meaning
	 * using two-column layout. See 'protected/views/layouts/column2.php'.
	 */
	public $layout='//layouts/column2';

	/*
	public function filters() {
        return array('rights',);
    }
    */
    
	public function actionView($id)
	{
			
		$this->render('view',array(
			'model'=>$this->loadModel($id),
			'id'=>$id,
		));
		
    }


	public function loadModel($id)
	{
		$model=TugasWewenang::model()->find('id_bidang='.$id);
		return $model;
	}

	/**
	 * Performs the AJAX validation.
	 * @param CModel the model to be validated
	 */
	protected function performAjaxValidation($model)
	{
		if(isset($_POST['ajax']) && $_POST['ajax']==='posting-form')
		{
			echo CActiveForm::validate($model);
			Yii::app()->end();
		}
	}
        
}
